﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModifyMCode.aspx.cs" Inherits="RGPWEB.admin.MCode.ModifyMCode" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>修改物料编码原则</title>
     <link href="../../inc/Style/index.css" rel="stylesheet" type="text/css" />
    <link href="../../inc/Style/childindex.css" rel="stylesheet" type="text/css" />
    <link href="../../inc/Style/GridView.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style3
        {
            width: 38px;
            text-align: right;
            height: 17px;
        }
        .style4
        {
            width: 52px;
            text-align: right;
            height: 17px;
        }
        .style5
        {
            width: 15px;
            height: 17px;
        }
        .style6
        {
            width: 45px;
            text-align: center;
            height: 17px;
        }
        .style8
        {
            width: 196px;
            height: 17px;
        }
        .style9
        {
            width: 37px;
            height: 17px;
        }
        .style10
        {
            width: 57px;
            height: 17px;
        }
        .style12
        {
            width: 40px;
            height: 17px;
        }
        .style13
        {
            width: 39px;
            height: 17px;
        }
        .style14
        {
            height: 17px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:Panel ID="TitlePanel" runat="server" CssClass="titlePadding" Height="21px" 
        Width="800px">
        修改物料编码规则
    </asp:Panel>   
    </div>
    
 
    
    <div>
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="id" Height="50px" Width="178px" Visible="False">
            <Fields>
                <asp:BoundField DataField="id" HeaderText="序号" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="ClassItem" HeaderText="代码" 
                    SortExpression="ClassItem" />
                <asp:BoundField DataField="ClassCode" HeaderText="编号" 
                    SortExpression="ClassCode" />
                <asp:BoundField DataField="ClassType" HeaderText="类型" 
                    SortExpression="ClassType" />
                <asp:BoundField DataField="ClassNote" HeaderText="备注" 
                    SortExpression="ClassNote" />
                <asp:BoundField DataField="ClassGroup" HeaderText="组别" 
                    SortExpression="ClassGroup" />
                <asp:BoundField DataField="ClassGroupName" HeaderText="组名" 
                    SortExpression="ClassGroupName" />
                <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
    </div>
    <div>
    

       
    
    
        <table class="style1">
            <tr>
                <td class="style6">
                    &nbsp;</td>
                <td class="style6">
                    <asp:TextBox ID="TextBox1" runat="server" Height="18px" Width="146px"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:Button ID="ButtonFind" runat="server" Height="24px" 
                        onclick="ButtonFind_Click" Text="筛选" Width="71px" />
                </td>
                <td class="style3">
                    <asp:Button ID="ButtonShowAll" runat="server" Height="24px" 
                        onclick="ButtonShowAll_Click" Text="全部显示" />
                </td>
                <td class="style12">
                    <asp:Button ID="ButtonAdd" runat="server" Height="24px" 
                        onclick="ButtonAdd_Click" Text="添加记录" Width="71px" Visible="False" />
                </td>
                <td class="style4">
                    组别：</td>
                <td class="style8">
                    <asp:DropDownList ID="DropDownListClassGroup" runat="server" 
                        AppendDataBoundItems="True" DataSourceID="ObjectDataSourceSelectClassGroup" 
                        DataTextField="ClassGroupName" DataValueField="ClassGroupName" Height="16px" 
                        ontextchanged="DropDownListClassGroup_TextChanged" Width="180px">
                    </asp:DropDownList>
                </td>
                <td class="style9">
                    编号：</td>
                <td class="style10">
                    <asp:DropDownList ID="DropDownList2" runat="server" 
                        DataSourceID="ObjectDataSourceSelectItem" DataTextField="ClassItem" 
                        DataValueField="ClassItem" Height="17px" 
                        ontextchanged="DropDownList2_TextChanged" Width="92px">
                    </asp:DropDownList>
                </td>
                <td class="style13">
                    &nbsp;</td>
                <td class="style14">
                    &nbsp;</td>
            </tr>
        </table>
    

       
    
    
    </div>
    <div>
        <asp:GridView ID="GridView1" runat="server" 
            AutoGenerateColumns="False" DataKeyNames="id" Width="100%" 
            BackColor="White" BorderColor="#DEDFDE" 
            BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" 
            GridLines="Vertical" UseAccessibleHeader="False" 
            onrowcommand="GridView1_RowCommand" onrowdatabound="GridView1_RowDataBound" 
            onselectedindexchanging="GridView1_SelectedIndexChanging" ShowFooter="True">
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:CommandField ShowSelectButton="True">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" 
                        Wrap="False" />
                </asp:CommandField>
                <asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="更新"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="取消"></asp:LinkButton>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:Button ID="ButtonReAdd" runat="server" CommandName="Insert" 
                            onclick="ButtonReAdd_Click" Text="追加记录" />
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="编辑"></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" 
                        Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="序号" InsertVisible="False" SortExpression="id">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbID" runat="server" Text='<%# Bind("id") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="代码" SortExpression="ClassItem">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ClassItem") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbfMItem" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbItem" runat="server" Text='<%# Bind("ClassItem") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编号" SortExpression="ClassCode">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ClassCode") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbfMCode" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbCode" runat="server" Text='<%# Bind("ClassCode") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="类型" SortExpression="ClassType">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ClassType") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbfMType" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbType" runat="server" Text='<%# Bind("ClassType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="组别" SortExpression="ClassGroup">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ClassGroup") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbfMGroup" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbGroup" runat="server" Text='<%# Bind("ClassGroup") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="组名" SortExpression="ClassGroupName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("ClassGroupName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbfMGroupName" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbGroupName" runat="server" Text='<%# Bind("ClassGroupName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="备注" SortExpression="ClassNote">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("ClassNote") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbfMNote" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbNote" runat="server" Text='<%# Bind("ClassNote") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSourceSelectClassGroup" runat="server" 
            InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetClassGroupName" TypeName="MCodeBll" UpdateMethod="UpdateQuery">
            <UpdateParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
                <asp:Parameter Name="original_id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSourceSelectAll" runat="server" 
            InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetMcodeByList" TypeName="MCodeBll" 
            UpdateMethod="UpdateQuery">
            <UpdateParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
                <asp:Parameter Name="original_id" Type="Int32" />
            </UpdateParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList2" Name="classItem" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="DropDownListClassGroup" Name="classGroupName" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSourceShowAll" runat="server" 
            InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
            onselecting="ObjectDataSourceShowAll_Selecting" SelectMethod="GetMCode" 
            TypeName="MCodeBll" UpdateMethod="UpdateQuery">
            <UpdateParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
                <asp:Parameter Name="original_id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
            </InsertParameters>

            
            
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetDataByLike" TypeName="MCodeBll" UpdateMethod="UpdateQuery">
            <UpdateParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
                <asp:Parameter Name="original_id" Type="Int32" />
            </UpdateParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="value" PropertyName="Text" 
                    Type="String" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSourceSelectItem" runat="server" 
            InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetClassItem" TypeName="MCodeBll" UpdateMethod="UpdateQuery">
            <UpdateParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
                <asp:Parameter Name="original_id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSourceInsert" runat="server" 
            InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
            oninserting="ObjectDataSourceInsert_Inserting" SelectMethod="GetDataByLike" 
            TypeName="MCodeBll">
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="value" PropertyName="Text" 
                    Type="String" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="ClassItem" Type="String" />
                <asp:Parameter Name="ClassCode" Type="String" />
                <asp:Parameter Name="ClassType" Type="String" />
                <asp:Parameter Name="ClassNote" Type="String" />
                <asp:Parameter Name="ClassGroup" Type="String" />
                <asp:Parameter Name="ClassGroupName" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        
    </div>
    
    
    
    
    
           <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="DropDownListClassGroup" 
                    EventName="TextChanged">
                </asp:AsyncPostBackTrigger>
                <asp:AsyncPostBackTrigger ControlID="DropDownList2" EventName="TextChanged">
                </asp:AsyncPostBackTrigger>
                <asp:AsyncPostBackTrigger ControlID="TextBox1" EventName="TextChanged">
                </asp:AsyncPostBackTrigger>
            </Triggers>
    
    
       
        
         </asp:UpdatePanel>
        
    
    
    
    </form>
</body>
</html>
